package com.dmlll.service;

import com.dmlll.VO.*;
import com.dmlll.domain.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author dmLll
 * @since 2021-03-31
 */
public interface DrugMessageService extends IService<DrugMessage> {

    /**
     * 药品目录查询
     * */
    PageInfo<ZjsVO> selectCatalogue(
            Integer pageNum,
            Integer pageSize,
            String serialNumber,
            String commonName,
            String dosageForm,
            String size,
            String unit,
            Integer factor,
            String category);

    /**
     *     勾选导出
     */
    List<ZjsVO> findByIdList(Integer[] idList);

    /**
     * 查看详情
     */
    PageInfo<ZjsinformationVO>selectDrugInformation(
            Integer pageNum,
            Integer pageSize,
            String serialNumber,
            String commonName,
            String dosageForm,
            String size,
            String unit,
            Integer factor,
            String productionName,
            Double winPrice,
            String commodityName,
            Double winPriceMin,
            Double winPriceMax,
            String category,
            Integer quality,
            Integer transaction
    );

    /**
     * 导出全部
     */
    List<ZjsinformationVO>selectZjsList();


    /**
     *根据采购目录查询
     */
    PageInfo<ZjsinformationVO>selectDrugInformationList(
            Integer pageNum,
            Integer pageSize,
            String serialNumber,
            String commonName,
            String dosageForm,
            String size,
            String unit,
            Integer factor,
            String productionName,
            Double winPrice,
            String commodityName,
            Double winPriceMin,
            Double winPriceMax,
            String category,
            Integer quality,
            Integer transaction
    );

    /**
     * 批量添加(查询出需要添加的数据)
     */
    List<ProviderDrugCatalogControl> insertIdList(Integer[] idList);

    /**
     * 添加
     */
    int insertPurchase( HospitalPurchaseCatalog[] hospitalPurchaseCatalogs);

    /**
     *查询医院采购维护
     */
            PageInfo<ZjsinformationVO>selectMaintain(
                    Integer pageNum,
                    Integer pageSize,
                    String serialNumber,
                    String commonName,
                    String dosageForm,
                    String size,
                    String unit,
                    Integer factor,
                    String productionName,
                    Double winPrice,
                    String commodityName,
                    Double winPriceMin,
                    Double winPriceMax,
                    String category,
                    Integer quality,
                    Integer transaction
            );

    /**
     * 根据ID删除医院采购目录维护
     */
    int delectMaintain(Integer[] idList);

    /**
     * 勾选导出医院采购单维护目录
     */
    List<ZjsinformationVO>selectMaintainIdList(Integer[] idList);

    /**
            * 查询供货商
     */
     List<Provider> selectProviderIdName();


    /**
     * 退货药品总查询
     */
    PageInfo<ZjsSalesReturnVO> selectSalesReturnCatalogue(ZjsSalesReturnVO zjsSalesReturnVO, Integer pageNum, Integer pageSize);

    /**
     * 查询退货单
     */
    PageInfo<ZjsGoodsNoteVO> selectGoodsNote(ZjsGoodsNoteVO zjsGoodsNoteVO, Integer pageNum, Integer pageSize);

    /**
     * 添加退货单
     */
    int insertGoodsNote(HospitalOutput hospitalOutput);

    /**
     * 根据ID查询退货单ID
     */
    List<ZjsGoodsNoteVO> selectIdReturn(Integer Sid);


    /**
     *查询药品退货详情
     */
    PageInfo<ZjsAddquantityVO>selectAddquantity(ZjsAddquantityVO zjsAddquantityVO, Integer pageNum, Integer pageSize);

    /**
     *添加退货药品详细的信息
     */
    int insertAddquantity(HospitalOutputDetail[] hospitalOutputDetail);

    /**
     * 查询出要添加的值
     * purchase_id，drug_message_id
     */
    List<PurchaseDrupDetail> selectInsertValue(Integer[] idList);

    /**
     * 根据ID删除采购单详细
     */
    int delectReturn(Integer[] idList);

    /**
     * 查询结算单
     */
    PageInfo<ZjsFinalStatementVO> selectFinal(ZjsFinalStatementVO zjsFinalStatementVO,Integer pageNum,Integer pageSize);

    /**
     * 添加结算单
     */
    int insertFinal(HospitalClose hospitalClose);

    /**
     *提交退货单信息
     * (修改退货单状态)
     */
    int updateQuantity(Integer id);

    /**
     * 根据ID删除退货单内已添加的药品
     */
    int delectSalesDrug(Integer[] idList);

    /**
     * 根据结算单查询药品
     */
    PageInfo<ZjsClearingDrugs>selectClearing(ZjsClearingDrugs zjsClearingDrugs,Integer pageNum,Integer pageSize);

    /**
     * 根据结算单查询结算单详细
     */
     List<ZjsSelectClearingVO> selectFinalParticulars(Integer id);

    /**
     * 提交结算单
     * 修改结算单状态（close_state）
     */
    int updateCloseState(Integer id);

    /**
     * 删除结算单内已有的药品
     */
    int deleteFinalDrug(Integer[] idList);

    /**
     * 采购单统计查询
     */
    PageInfo<ZjsPurchaseOrdersVO>selectPurchase(ZjsPurchaseOrdersVO zjsPurchaseOrdersVO,Integer pageNum,Integer pageSize);

    /**
     * 勾选导出采购单统计
     */
    List<ZjsPurchaseOrdersVO>selectPurchaseByIdList(Integer[] idList);


    /**
     * 供应商统计查询
     */
    PageInfo<ZjsSupplierVO>selectSupplier(ZjsSupplierVO zjsSupplierVO,Integer pageNum,Integer pageSize);


    /**
     * 勾选导出供应商统计
     */
    List<ZjsSupplierVO>selectSupplierByIdList(Integer[] idList);

    /**
     * 查询医院信息
     * id，医院名称
     */
    List<Hospital> selectHospitalIdName();

    /**
     * 医院统计查询
     */
    PageInfo<ZjsHospitalStatisticsVO> selectHospitalStatistics(ZjsHospitalStatisticsVO zjsHospitalStatisticsVO,Integer pageNum,Integer pageSize);

    /**
     * 勾选导出供应商统计
     */
    List<ZjsHospitalStatisticsVO>selectHospitalByIdList(Integer[] idList);


    /**
     * 交易药品统计查询
     */
    PageInfo<ZjsDealStatisticsVO>selectDeal(ZjsDealStatisticsVO zjsDealStatisticsVO,Integer pageNum,Integer pageSize);


    /**
     * 勾选导出交易药品统计
     */
    List<ZjsDealStatisticsVO>selectDealByIdList(Integer[] idList);

}
